1. Field of the Invention
This invention relates to a method and an apparatus for controlling a robot, and more particularly to a method and an apparatus for controlling a robot in which positional compensation is performed by the use of a neural network.
2. Discussion of Related Art
In industrial robots, positional errors are produced due to dimensional errors of their arms which are caused by machining error, assembly error, thermal deformation and the like, and bend of each arm which is caused by its weight, and other factors. In a conventional controller for an industrial robot, a positional matrix Mm is initially obtained which indicates a target position of the end effecter of the robot, and the positional matrix is then subjected to reverse conversion using a reverse conversion function fa, in which the above-mentioned errors are taken into consideration, so as to obtain a joint angle vector Aa indicating target angular positions of the respective joints of the robot. The joints are moved in accordance with the joint angle vector Aa so as to position the end effecter of the robot to the target position.
As described above, the joint angle vector Aa is obtained by reverse conversion of the target position matrix Mm with the reverse conversion function in which the above-mentioned errors are compensated for. However, if the reverse conversion or coordinate conversion is carried out with taking all of the causes of the errors into consideration, the processing of the coordinate conversion becomes extremely difficult. Further, the amount of calculation becomes large because of the complicated mathematical analysis. Accordingly, in the conventional robot controller, compensation is carried out with only limited numbers or causes of errors being taken into consideration. Therefore, the positioning accuracy of the conventional robots is insufficient. This will be further explained. Formula (1) shows a relationship between a target position and an actual position of the end effecter of a robot. ##STR1## wherein
Mm: target position matrix;
fa: reverse conversion function in which limited number of errors are taken into consideration;
Aa: joint angle vector as a control target;
gt: actual forward conversion function indicating mechanical conversion in which all the errors are reflected;
Ma: position matrix indicating an actual position of the end effecter of the robot which has been moved in accordance with Aa.
In such a robot controller, a positioning error dMe can be expressed as dMe=Ma-Mm.
As is understood from the formula (1), the joint angle vector Aa is obtained by reversely converting the target position matrix Mm using the reverse conversion function fa, in which only limited number of causes of errors are taken into consideration. Accordingly, the position matrix Ma indicating the actual position of the end effecter of the robot does not coincide with the target position matrix Mm, and an positioning error dMe is produced due to errors which have not been taken into consideration.
Further, the above-mentioned positioning error increases and changes as the time elapses. To eliminate positioning error, it is required to measure the positioning error at predetermined intervals and to compensate the target position according to the measured error. This is time consuming and troublesome.
In the meantime, a controller having all off-line teaching apparatus shown in FIG. 1 has been proposed. In the off-line teaching system 700, a target position Mm is initially generated at a section 701 which is then held at a memory section 702. In a section 703, the target position Mm is compensated for errors with the use of a mathematical model, in which errors such as error in lengths of arms of a robot 710, angular position error caused during assembly of the arms, and the like are taken into consideration so as to obtain a compensated target position Mm. The compensated target position Mm is written into a data storage such as a floppy disc at a section 704. When an operator wants to operate the robot 710, the operator inserts the floppy disc into a floppy drive (not shown) of the robot controller 750. A control section 752 of the robot controller 750 reads out the compensated target position Mm' from the floppy disc via a temporary memory section 751 so as to control the movement of the robot 710.
Even when it is tried to carry out compensation of the target position Mm with the use of the mathematical model in which various causes of errors are taken into consideration, satisfactory result cannot be obtained, because the causes of positioning errors are manifold and are difficult to be completely expressed in the mathematical model. Therefore, accurate compensation cannot be carried out.